package com.whfc.wxmp.api.fim.service.impl;

import com.whfc.entity.param.warn.AppWarnHandleParam;
import com.whfc.fim.dto.FimResultDTO;
import com.whfc.fim.param.FimResultEditParam;
import com.whfc.fim.service.FimResultService;
import com.whfc.fuum.entity.WxUser;
import com.whfc.wxmp.api.fim.service.WxFimWarnService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @author: xugcheng
 * @version: 1.0
 * @date: 2020-11-02 17:39
 */
@Service
public class WxFimWarnServiceImpl implements WxFimWarnService {

    @DubboReference(interfaceClass = FimResultService.class, version = "1.0.0")
    private FimResultService fimResultService;

    @Override
    public FimResultDTO getFimWarnDetail(Integer warnId) {
        FimResultDTO detail = fimResultService.detail(warnId);
        return detail;
    }

    @Override
    public void handleFimWarn(WxUser loginUser, AppWarnHandleParam body) {
        FimResultEditParam request = new FimResultEditParam();
        request.setResultId(body.getWarnId());
        request.setHandleUserId(loginUser.getId());
        request.setHandleUserName(loginUser.getNickName());
        request.setHandleRemark(body.getHandleRemark());
        request.setHandleResult(body.getHandleResult());
        fimResultService.handle(request);
    }
}
